package com.example.siyun.service.impl.permissionsserviceimpl;

import com.example.siyun.mapper.permissionsmapper.CustomerManageMapper;
import com.example.siyun.pojo.CustomerManage;
import com.example.siyun.pojo.EnumPojo;
import com.example.siyun.service.permissionsservice.CustomerManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Auther: 全
 * @Date: 2022/9/26 09:33
 * @Description:权限管理模块客服管理
 */
@Service
public class CustomerManageServiceImpl implements CustomerManageService {
    @Autowired
    private CustomerManageMapper customerManageMapper;
    /**
     * 获取客服管理的数据
     * @return 返回客服管理的数据
     */
    @Transactional
    @Override
    public List<CustomerManage> getCustomerManage(CustomerManage customerManage,int isdel) {
        return customerManageMapper.getCustomerManage(customerManage,isdel);
    }
    @Transactional
    @Override
    public Map<String, Object> selectCustomerHeader() {
        Map map=new HashMap();
        Integer selectjrjdrs = customerManageMapper.selectJrjdrs();
        Integer selectzrjdrs = customerManageMapper.selectZrjdrs();
        Integer selectbyjdrs = customerManageMapper.selectByjdrs();
        Integer selectzjdrs = customerManageMapper.selectZjdrs(EnumPojo.VALUE_DEL_0);
        map.put("selectjrjdrs",selectjrjdrs);
        map.put("selectzrjdrs",selectzrjdrs);
        map.put("selectbyjdrs",selectbyjdrs);
        map.put("selectzjdrs",selectzjdrs);
        return map;
    }
    /**
     * 通过id获取客服管理信息
     * @return 返回客服管理信息
     */
    @Transactional
    @Override
    public CustomerManage getC(int id) {
        return customerManageMapper.getC(id);
    }
    /**
     * 通过id删除对应的客服管理信息
     * @param  id 要删除的客服管理信息id
     */
    @Transactional
    @Override
    public void delcustomerbyid(int id) {
        customerManageMapper.delcustomerbyid(id,EnumPojo.VALUE_DEL_1);
    }
}
